package com.service;

import java.util.Map;

public interface DocService {
    /**
     * 添加数据,自动生成id
     * @param index
     * @throws Exception
     */
    void addDoc(String index, Map source) throws Exception;

    void addDoc(String index, String jsonSource) throws Exception;

    void addDocWithId(String index, String jsonSource, String id) throws Exception;

    /**
     * 根据id查询文档
     * @param index
     * @param id
     * @throws Exception
     */
    void getDocById(String index, String id) throws Exception;

    /**
     * 按照id更新数据
     * @param index
     * @param id
     * @param jsonSource
     * @throws Exception
     */
    void updateDocById(String index, String id, String jsonSource) throws Exception;

    /**
     * 根据id删除数据
     * @param index
     * @param id
     * @throws Exception
     */
    void deleteDocById(String index, String id) throws Exception;
}
